<template>
  <div>
    <h3>child1 --- {{ age }}</h3>
    <!-- <button @click="$emit('onAddAge', 1)">++++</button> -->
    <button @click="setAge">++++</button>
  </div>
</template>

<script>
export default {
  props: ['age'],
  created() {
    // console.log(this.$eventBus)
  },
  methods: {
    setAge() {
      // 参数1：频道名称,不能重复
      // 参数2-N，传过去的数据
      this.$eventBus.$emit('age', 10)
    }
  }
}
</script>

<style lang="scss" scoped></style>
